import { GET, POST } from '@/api';
import { UserRole } from '@/types/enum';

// 获取字典
export const getDict = (dict: string) => GET(`/household/common/getDict/${dict}`);

// 服务类目（全量）
export const fullLevel = <T>(data?: T) => GET('/household/serviceType/fullLevel', data);

// 根据第三级返回前面两级地址
export const level3Code = (code: string) => GET(`/household/regions/level3Code/${code}`);

// 获取APP版本信息
export const getAppVersion = () => GET('/household/appVersion/getAppVersion');

// 角色身份切换
export const switchMeberRoles = (role: UserRole) => GET(`/switchMeberRoles/${role}`);

// 订单未读消息统计
export const orderMessageStatistics = <T>(data: T) => POST('/household/orderNotification/messageStatistics', data);

// 订单消息设置已读
export const orderNotificationRead = (id: number) => GET(`/household/orderNotification/read/${id}`);